package weatherwidget.isrefluxer.bird.com.birdweatherwidget.until;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created by Administrator on 2016/11/23 0023.
 */

public class FileUtil {
    public static void copyFile(InputStream source, String target)
            throws IOException {
        BufferedOutputStream bos = new BufferedOutputStream(
                new FileOutputStream(target));
        byte[] buffers = new byte[1024 * 10];
        int len;
        while ((len = source.read(buffers)) != -1) {
            bos.write(buffers, 0, len);
        }
        bos.flush();
        bos.close();
        source.close();
    }
}
